package com.wei.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wei.mapper.BrandMapper;
import com.wei.model.BrandDO;
import com.wei.service.IBrandService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

@Service
@RequiredArgsConstructor
public class BrandServiceImpl extends ServiceImpl<BrandMapper, BrandDO> implements IBrandService {

    private final BrandMapper brandMapper;

    @Override
    public List<BrandDO> listAllBrands() {
        LambdaQueryWrapper<BrandDO> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.select(BrandDO::getId, BrandDO::getName);
        return brandMapper.selectList(queryWrapper);
    }
}
